package org.pearl.freemarker.demo.springbootfreemarkerdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by TD on 2021/6/17
 */
@Controller
public class IndexController {

    @RequestMapping("/index")
    public String index(Model model) {
        Map<String, Object> attributes = new HashMap<>();
        attributes.put("name", "张三！");
        //
        model.addAllAttributes(attributes);
        return "index";
    }
}
